<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>安装</title>
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-base.css" />
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-medium.css" />

 </head>
 <body class="docs"><div class="navbar navbar-fixed-top">
  <div class="navbar-inner clearfix">
    <ul class="nav" style="width: 100%">
      <li style="float: left;"><a href="dba.requirements.html">« 需求</a></li>
      <li style="float: right;"><a href="dba.configuration.html">运行时配置 »</a></li>
    </ul>
  </div>
</div>
<div id="breadcrumbs" class="clearfix">
  <ul class="breadcrumbs-container">
    <li><a href="index.html">PHP Manual</a></li>
    <li><a href="dba.setup.html">安装/配置</a></li>
    <li>安装</li>
  </ul>
</div>
<div id="layout">
  <div id="layout-content"><div id="dba.installation" class="section">
 <h2 class="title">安装</h2>
 <p class="para">
  By using the <strong class="option configure">--enable-dba=shared</strong>
  configuration option you can build a dynamic loadable module to enable PHP
  for basic support of dbm-style databases. You also have to add support
  for at least one of the following handlers by specifying the
  <strong class="option configure">--with-XXXX</strong> or <strong class="option configure">--enable-XXXX</strong> configure switch to your PHP
  configure line.
 </p>
 <div class="warning"><strong class="warning">警告</strong>
  <p class="para">
   After configuring and compiling PHP you must execute the following test
   from commandline: <code class="literal">php run-tests.php ext/dba</code>. This shows
   whether your combination of handlers works. Most problematic are 
   <code class="literal">dbm</code> and <code class="literal">ndbm</code> which conflict with
   many installations. The reason for this is that on several systems these
   libraries are part of more than one other library. The configuration test
   only prevents you from configuring malfunctioning single handlers but not 
   combinations.
  </p>
 </div>
 <p class="para">
  <table class="doctable table">
   <caption><strong>Supported DBA handlers</strong></caption>
   
    <thead>
     <tr>
      <th>Handler</th>
      <th>Configure Switch</th>
     </tr>

    </thead>

    <tbody class="tbody">
     <tr>
      <td><code class="literal">dbm</code></td>
      <td>
       <p class="para">
       To enable support for dbm add
       <strong class="option configure">--with-dbm[=DIR]</strong>.
       <blockquote class="note"><p><strong class="note">注意</strong>: 
        <p class="para">
         dbm normally is a wrapper which often results in failures.
         This means you should only use dbm if you are sure it works
         and if you really need this format.
        </p>
       </p></blockquote>
       </p>
      </td>
     </tr>


     <tr>
      <td><code class="literal">ndbm</code></td>
      <td>
       <p class="para">
       To enable support for ndbm add
       <strong class="option configure">--with-ndbm[=DIR]</strong>.
       <blockquote class="note"><p><strong class="note">注意</strong>: 
        <p class="para">
         ndbm normally is a wrapper which often results in failures.
         This means you should only use ndbm if you are sure it works
         and if you really need this format.
        </p>
       </p></blockquote>
       </p>
      </td>
     </tr>


     <tr>
      <td><code class="literal">gdbm</code></td>
      <td>
       To enable support for gdbm add
       <strong class="option configure">--with-gdbm[=DIR]</strong>.
      </td>
     </tr>


     <tr>
      <td><code class="literal">db2</code></td>
      <td>
       <p class="para">
       To enable support for Oracle Berkeley DB 2 add
       <strong class="option configure">--with-db2[=DIR]</strong>.
       <blockquote class="note"><p><strong class="note">注意</strong>: 
        <p class="para">
         db2 conflicts with db3 and db4.
        </p>
       </p></blockquote>
       </p>
      </td>
     </tr>


     <tr>
      <td><code class="literal">db3</code></td>
      <td>
       <p class="para">
       To enable support for Oracle Berkeley DB 3 add
       <strong class="option configure">--with-db3[=DIR]</strong>.
       <blockquote class="note"><p><strong class="note">注意</strong>: 
        <p class="para">
         db3 conflicts with db2 and db4.
        </p>
       </p></blockquote>
       </p>
      </td>
     </tr>


     <tr>
      <td><code class="literal">db4</code></td>
      <td>
       <p class="para">
       To enable support for Oracle Berkeley DB 4 or 5 add
       <strong class="option configure">--with-db4[=DIR]</strong>.
       <blockquote class="note"><p><strong class="note">注意</strong>: 
        <p class="para">
         db4 conflicts with db2 and db3.
        </p>
       </p></blockquote>
       <blockquote class="note"><p><strong class="note">注意</strong>: 
        <p class="para">
         The db libraries with
         versions 4.1 through 4.1.24 cannot be used in any PHP version.
        </p>
        <p class="para">
         Support for BDB 5 was added in PHP 5.3.3.
        </p>
       </p></blockquote>
      </p>
      </td>
     </tr>


     <tr>
      <td><code class="literal">cdb</code></td>
      <td>
       <p class="para">
       To enable support for cdb add
       <strong class="option configure">--with-cdb[=DIR]</strong>.
       <blockquote class="note"><p><strong class="note">注意</strong>: 
        <p class="para">
         You can omit DIR to use the bundled cdb library 
         that adds the cdb_make handler which allows creation of cdb files
         and allows to access cdb files on the network using PHP&#039;s streams.
        </p>
       </p></blockquote>
       </p>
      </td>
     </tr>


     <tr>
      <td><code class="literal">flatfile</code></td>
      <td>
       <p class="para">
       To enable support for flatfile add
       <strong class="option configure">--enable-flatfile</strong>.
       Before PHP 5.2.1 the <strong class="option configure">--with-flatfile</strong>
       had to be used instead.
       <blockquote class="note"><p><strong class="note">注意</strong>: 
        <p class="para">
         This was added to add compatibility with deprecated
         <code class="literal">dbm</code> extension. Use this handler only
         when you cannot install one of the libraries required by the other
         handlers and when you cannot use bundled cdb handler.
        </p>
       </p></blockquote>
       </p>
      </td>
     </tr>


     <tr>
      <td><code class="literal">inifile</code></td>
      <td>
       <p class="para">
       To enable support for <code class="literal">inifile</code> add
       <strong class="option configure">--enable-inifile</strong>.
       Before PHP 5.2.1 the <strong class="option configure">--with-inifile</strong>
       had to be used instead.
       <blockquote class="note"><p><strong class="note">注意</strong>: 
        <p class="para">
         This was added to allow to read and set microsoft style
         <var class="filename">.ini</var> files (like the <var class="filename">php.ini</var> file).
        </p>
       </p></blockquote>
       </p>
      </td>
     </tr>


     <tr>
      <td><code class="literal">qdbm</code></td>
      <td>
       <p class="para">
       To enable support for qdbm add
       <strong class="option configure">--with-qdbm[=DIR]</strong>.
       <blockquote class="note"><p><strong class="note">注意</strong>: 
        <p class="para">
         qdbm conflicts with dbm and gdbm.
        </p>
       </p></blockquote>
       <blockquote class="note"><p><strong class="note">注意</strong>: 
        <p class="para">
         The qdbm library can be downloaded from
         <a href="http://fallabs.com/qdbm/index.html" class="link external">&raquo;&nbsp;http://fallabs.com/qdbm/index.html</a>.
        </p>
       </p></blockquote>
       </p>
      </td>
     </tr>


     <tr>
      <td><code class="literal">tcadb</code></td>
      <td>
       <p class="para">
       To enable support for Tokyo Cabinet add
       <strong class="option configure">--with-tcadb[=DIR]</strong>.
       <blockquote class="note"><p><strong class="note">注意</strong>: 
        <p class="para">
         The Tokyo Cabinet library can be downloaded from
         <a href="http://fallabs.com/tokyocabinet/" class="link external">&raquo;&nbsp;http://fallabs.com/tokyocabinet/</a>.
        </p>
       </p></blockquote>
       </p>
      </td>
     </tr>


     <tr>
      <td><code class="literal">lmdb</code></td>
      <td>
       <p class="para">
       To enable support for the Lightning Memory-Mapped Database add
       <strong class="option configure">--with-lmdb[=DIR]</strong>.
       <blockquote class="note"><p><strong class="note">注意</strong>: 
        <p class="para">
         This was added in PHP 7.2.0. The Lightning Memory-Mapped Database
         library can be downloaded from <a href="https://symas.com/lmdb/" class="link external">&raquo;&nbsp;https://symas.com/lmdb/</a>.
        </p>
       </p></blockquote>
       </p>
      </td>
     </tr>


    </tbody>
   
  </table>

 </p>
</div></div></div></body></html>